package API.JDK8时间.工具类;

import java.time.LocalDateTime;
import java.time.temporal.ChronoUnit;

public class chronoUnit {
    public static void main(String[] args) {
        LocalDateTime now = LocalDateTime.now();
        System.out.println(now);

        LocalDateTime localDateTime = LocalDateTime.of(2000, 1, 1, 0, 0, 0);
        System.out.println(localDateTime);

        long between = ChronoUnit.YEARS.between(localDateTime, now);
        long between1 = ChronoUnit.MONTHS.between(localDateTime, now);
        /*
        * YRARS:年数
        * MONTHS:月份
        * WEEKS:周数
        * 。。。。HOURS,SECONDS,MINUTES
        * MILLIS:毫秒
        * MICROS:微妙
        * NANOS:纳秒
        * HALD_DAYS:半天
        * DECADES:几十年
        * CENTURIES:世纪
        * MILLENNIA:千年
        * ERAS:纪元
        * */


    }
}
